Planarity testing

In graph theory, the planarity testing problem asks whether, given a graph, that graph is a planar graph (can be drawn in the plane without edge intersections). This is a well-studied problem in computer science for which many practical algorithms have emerged, many taking advantage of novel data structures. Most of these methods operate in O(n) time (linear time), where n is the number of edges (or vertices) in the graph, which is asymptotically optimal.

Contents

Simple algorithms and planarity characterizations

By Fáry's theorem we can assume the edges in the graph drawing, if any, are straight line segments. Given such a drawing for the graph, we can verify that there are no crossings using well-known line segment intersection algorithms that operate in O(n log n) time. However, this is not a particularly good solution, for several reasons:

For these reasons, planarity testing algorithms take advantage of theorems in graph theory that characterize the set of planar graphs in terms that are independent of graph drawings. One of these is Kuratowski's theorem, which states that:

A finite graph is planar if and only if it does not contain a subgraph that is a subdivision of K5 (the complete graph on five vertices) or K3,3 (complete bipartite graph on six vertices, three of which connect to each of the other three).

A graph can be demonstrated to be nonplanar by exhibiting a subgraph matching the above description, and this can be easily verified, which places the problem in co-NP. However, this also doesn't by itself produce a good algorithm, since there are a large number of subgraphs to consider (K5 and K3,3 are fixed in size, but a graph can contain 2Ω(m) subdivisions of them).

A simple theorem allows graphs with too many edges to be quickly determined to be nonplanar, but cannot be used to establish planarity. If v is the number of vertices (at least 3) and e is the number of edges, then the following imply nonplanarity:

e > 3v − 6 or;
There are no cycles of length 3 and e > 2v − 4.

For this reason n can be taken to be either the number of vertices or edges when using big O notation with planar graphs, since they differ by at most a constant multiple.

Path addition method

The classic path addition method of Hopcroft and Tarjan[1] was the first published linear-time planarity testing algorithm in 1974.

PQ tree vertex addition method

The vertex addition method began with an inefficient O(n2) method conceived by Lempel, Even and Cederbaum in 1967.[2] It was improved by Even and Tarjan, who found a linear-time solution for the s,t-numbering step,[3] and by Booth and Lueker, who developed the PQ tree data structure. With these improvements it is linear-time and outperforms the path addition method in practice.[4] This method was also extended to allow a planar embedding (drawing) to be efficiently computed for a planar graph.[5]

PC tree vertex addition method

In 1999, Shih and Hsu developed a planarity testing algorithm that was significantly simpler than classical methods based on a new type of data structure called the PC tree and a postorder traversal of the depth-first search tree of the vertices.[6]

Edge addition method

In 2004, Boyer and Myrvold [7] developed a simplified O(n) algorithm, originally inspired by the PQ tree method, which gets rid of the PQ tree and uses edge additions to compute a planar embedding, if possible. Otherwise, a Kuratowski subdivision (of either K5 or K3,3) is computed. This is one of the two current state-of-the-art algorithms today (the other one is the planarity testing algorithm of de Fraysseix, de Mendez and Rosenstiehl[8][9]). See [10] for an experimental comparison with a preliminary version of the Boyer and Myrvold planarity test. Furthermore, the Boyer–Myrvold test was extended to extract multiple Kuratowski subdivisions of a non-planar input graph in a running time linearly dependent on the output size.[11] The source code for the planarity test[12][13] and the extraction of multiple Kuratowski subdivisions[12] is publicly available. Algorithms that locate a Kuratowski subgraph in linear time in vertices were developed by Williamson in the 1980s.[14]

References

  1. ^ Hopcroft, John; Tarjan, Robert E. (1974), "Efficient planarity testing", Journal of the Association for Computing Machinery 21 (4): 549–568, doi:10.1145/321850.321852 .
  2. ^ Lempel, A.; Even, S.; Cederbaum, I. (1967), "An algorithm for planarity testing of graphs", in Rosenstiehl, P., Theory of Graphs, New York: Gordon and Breach, pp. 215–232 .
  3. ^ Even, Shimon; Tarjan, Robert E. (1976), "Computing an st-numbering", Theoretical Computer Science 2 (3): 339–344, doi:10.1016/0304-3975(76)90086-4 .
  4. ^ Boyer & Myrvold (2004), p. 243: “Its implementation in LEDA is slower than LEDA implementations of many other O(n)-time planarity algorithms.”
  5. ^ Chiba, N.; Nishizeki, T.; Abe, A.; Ozawa, T. (1985), "A linear algorithm for embedding planar graphs using PQ–trees", Journal of Computer and Systems Sciences 30 (1): 54–76, doi:10.1016/0022-0000(85)90004-2 .
  6. ^ Shih, W. K.; Hsu, W. L. (1999), "A new planarity test", Theoretical Computer Science 223 (1–2): 179–191, doi:10.1016/S0304-3975(98)00120-0 .
  7. ^ Boyer, John M.; Myrvold, Wendy J. (2004), "On the cutting edge: simplified O(n) planarity by edge addition", Journal of Graph Algorithms and Applications 8 (3): 241–273, http://jgaa.info/accepted/2004/BoyerMyrvold2004.8.3.pdf .
  8. ^ de Fraysseix, H.; Ossona de Mendez, P.; Rosenstiehl, P. (2006), "Trémaux Trees and Planarity", International Journal of Foundations of Computer Science 17 (5): 1017–1030, doi:10.1142/S0129054106004248 .
  9. ^ Brandes, Ulrik (2009), The left-right planarity test, http://www.inf.uni-konstanz.de/algo/publications/b-lrpt-sub.pdf .
  10. ^ Boyer, John M.; Cortese, P. F.; Patrignani, M.; Battista, G. D. (2003), "Stop minding your P's and Q's: implementing a fast and simple DFS-based planarity testing and embedding algorithm", Proc. 11th Int. Symp. Graph Drawing (GD '03), Lecture Notes in Computer Science, 2912, Springer-Verlag, pp. 25–36 
  11. ^ Chimani, M.; Mutzel, P.; Schmidt, J. M. (2008), "Efficient extraction of multiple Kuratowski subdivisions", Proc. 15th Int. Symp. Graph Drawing (GD'07), Lecture Notes in Computer Science, 4875, Sydney, Australia: Springer-Verlag, pp. 159–170 .
  12. ^ a b http://www.ogdf.net
  13. ^ http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/boyer_myrvold.html
  14. ^ Williamson, S. G. (1984), "Depth First Search and Kuratowski Subgraphs", Journal Association of Computing Machinery 31: 681–693